package com.zbj.consul.consumer;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * ConsulFeignClient
 * , fallback = FeignClientFallBack.class
 * @author weigang
 * @create 2019-08-10
 **/
@FeignClient(name = "consul-provider")
public interface ConsulFeignClient {

    /**
     * 调用提供者服务
     * 方法没有@RequestParam注解 则抛出异常 feign.FeignException$MethodNotAllowed: status 405 reading ConsulFeignClient#sayHelloFromClientConsul(String)
     *
     * @param world
     * @return
     */
    @RequestMapping(value = "/consul/provider/hello", method = {RequestMethod.GET})
    String sayHelloFromClientConsul(@RequestParam String world);
}